package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyu.pojo.Org;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrgMapper extends BaseMapper<Org> {
    @Select("select * from smbms_org ${ew.customSqlSegment}")
    List<Org> findAll( Page page,@Param("ew") Wrapper wrapper);
    @Select("DELETE FROM smbms_org WHERE id=#{id} AND id NOT IN ( SELECT user_org FROM smbms_user)")
   String  removeId(Integer id);
    @Select("SELECT * FROM smbms_user WHERE user_org=#{id}")
    Integer selectYuan(Integer id);
}
